package com.zlm.website.controller;

import com.zlm.common.base.BaseController;
import com.zlm.common.dto.JsonResultDto;
import com.zlm.website.service.entity.SysBannerDO;
import com.zlm.website.service.service.SysBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 轮播图controller
 *
 * @Author: duyufu
 * @Date: 2019/3/18 10:25
 */
@RestController
@RequestMapping(value = "/banner")
public class BannerController extends BaseController {
    @Autowired
    private SysBannerService sysBannerService;

    /**
     * 按类别获取轮播图列表
     *
     * @param type
     * @return
     */
    @PostMapping("/getWebsiteBannerByType")
    public JsonResultDto getWebsiteBannerByType(Integer type) {
        List<SysBannerDO> bannerList = sysBannerService.getEntityByType(type);
        return success(bannerList);
    }

}
